//
//  FFCache.m
//  fitness-iOS
//
//  Created by 卢仕彤 on 2017/12/14.
//  Copyright © 2017年 卢仕彤. All rights reserved.
//

#import "FFCache.h"

@implementation FFCache

+ (void)setequipment:(NSString *)equipment {
    equipment = [NSString stringWithFormat:@"%@", equipment];
    [[NSUserDefaults standardUserDefaults] setObject:equipment forKey:EQUIPMENT];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

+ (NSString *)equipment {
    if (![[NSUserDefaults standardUserDefaults] objectForKey:EQUIPMENT]) {
        return @"";
    }
    return [[NSUserDefaults standardUserDefaults] objectForKey:EQUIPMENT];
}

+ (void)setToken:(NSString *)token {
    token = [NSString stringWithFormat:@"%@", token];
    [[NSUserDefaults standardUserDefaults] setObject:token forKey:TOKEN];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

+ (NSString *)token {
    if (![[NSUserDefaults standardUserDefaults] objectForKey:TOKEN]) {
        return @"";
    }
    return [[NSUserDefaults standardUserDefaults] objectForKey:TOKEN];
}
@end
